package com.example.factory.core.domain;


import javax.persistence.*;
import java.util.List;

/**
 * @author Lei Tao
 */

@Entity
@Table(name = "department")
public class Department extends DomainObject {

    /**
     * 部门名称
     */
    @Column(name = "name")
    private String name;

    /**
     * 部门描述
     */
    @Column(name = "description")
    private String description;

    @OneToMany(mappedBy = "department", fetch = FetchType.LAZY, orphanRemoval = true)
    private List<Equipment> equeues;

    @OneToMany(mappedBy = "department", fetch = FetchType.LAZY, orphanRemoval = true)
    private List<UserEntity> accounts;

    public Department() {
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public List<Equipment> getEqueues() {
        return equeues;
    }

    public void setEqueues(List<Equipment> equeues) {
        this.equeues = equeues;
    }

    public List<UserEntity> getAccounts() {
        return accounts;
    }

    public void setAccounts(List<UserEntity> accounts) {
        this.accounts = accounts;
    }
}
